package com.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the OFFERINFO database table.
 * 
 */
@Entity
@NamedQuery(name="Offerinfo.findAll", query="SELECT o FROM Offerinfo o")
public class Offerinfo implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="OFFERINFO_OIID_GENERATOR", sequenceName="OFFERINFO_SEQ",initialValue=1,allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="OFFERINFO_OIID_GENERATOR")
	private Long oiid;

	@Temporal(TemporalType.DATE)
	private Date birth;

	private String excangerate;

	private BigDecimal exceptprofit;

	private String giveexplain;

	private String goexplain;

	private String linkedway;

	private BigDecimal logic;

	private String offerno;

	private String payexplain;

	private BigDecimal price;

	private String remark;

	private String status;

	private String theme;
	
	@Transient
	private String range1;
	
	@Transient
	private String range2;
	
	@Transient
	private String range3;
	
	@Transient
	private String range4;
	
	@Transient
	private String range5;
	
	@Transient
	private String range6;
	
	@Transient
	private Date startDate;
	
	@Transient
	private Date endDate;
	
	@Transient
	private List<String> queryType;
	
	@Transient
	private List<String> queryToorder;
	
	

	@Temporal(TemporalType.DATE)
	@Column(name="\"TIME\"")
	private Date time;

	private String toorder;

	@Column(name="\"TYPE\"")
	private String type;

	//bi-directional many-to-one association to Chanceinfo
	@ManyToOne
	@JoinColumn(name="CIID")
	private Chanceinfo chanceinfo;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="USER_ID")
	private User user;
	
	//bi-directional many-to-one association to Customer
	@ManyToOne
	@JoinColumn(name="CUSNO")
	private Customer customer;
	
	//bi-directional many-to-one association to Linkman
	@ManyToOne
	@JoinColumn(name="LINKNO")
	private Linkman linkman;
	
	//bi-directional many-to-one association to Offerdetail
	@OneToMany(mappedBy="offerinfo")
	@JSONField(serialize=false)
	private List<Offerdetail> offerdetails;

	public Offerinfo() {
	}

	public Long getOiid() {
		return this.oiid;
	}

	public void setOiid(Long oiid) {
		this.oiid = oiid;
	}

	public Date getBirth() {
		return this.birth;
	}

	public void setBirth(Date birth) {
		this.birth = birth;
	}

	public String getExcangerate() {
		return this.excangerate;
	}

	public void setExcangerate(String excangerate) {
		this.excangerate = excangerate;
	}

	public BigDecimal getExceptprofit() {
		return this.exceptprofit;
	}

	public void setExceptprofit(BigDecimal exceptprofit) {
		this.exceptprofit = exceptprofit;
	}

	public String getGiveexplain() {
		return this.giveexplain;
	}

	public void setGiveexplain(String giveexplain) {
		this.giveexplain = giveexplain;
	}

	public String getGoexplain() {
		return this.goexplain;
	}

	public void setGoexplain(String goexplain) {
		this.goexplain = goexplain;
	}

	public String getLinkedway() {
		return this.linkedway;
	}

	public void setLinkedway(String linkedway) {
		this.linkedway = linkedway;
	}

	public BigDecimal getLogic() {
		return this.logic;
	}

	public void setLogic(BigDecimal logic) {
		this.logic = logic;
	}

	public String getOfferno() {
		return this.offerno;
	}

	public void setOfferno(String offerno) {
		this.offerno = offerno;
	}

	public String getPayexplain() {
		return this.payexplain;
	}

	public void setPayexplain(String payexplain) {
		this.payexplain = payexplain;
	}

	public BigDecimal getPrice() {
		return this.price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getTheme() {
		return this.theme;
	}

	public void setTheme(String theme) {
		this.theme = theme;
	}

	public Date getTime() {
		return this.time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public String getToorder() {
		return this.toorder;
	}

	public void setToorder(String toorder) {
		this.toorder = toorder;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Chanceinfo getChanceinfo() {
		return this.chanceinfo;
	}

	public void setChanceinfo(Chanceinfo chanceinfo) {
		this.chanceinfo = chanceinfo;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Linkman getLinkman() {
		return linkman;
	}

	public void setLinkman(Linkman linkman) {
		this.linkman = linkman;
	}

	public List<Offerdetail> getOfferdetails() {
		return offerdetails;
	}

	public void setOfferdetails(List<Offerdetail> offerdetails) {
		this.offerdetails = offerdetails;
	}
	
	public Offerdetail addOfferdetail(Offerdetail offerdetail) {
		getOfferdetails().add(offerdetail);
		offerdetail.setOfferinfo(this);

		return offerdetail;
	}

	public Offerdetail removeOfferdetail(Offerdetail offerdetail) {
		getOfferdetails().add(offerdetail);
		offerdetail.setOfferinfo(null);

		return offerdetail;
	}

	public String getRange1() {
		return range1;
	}

	public void setRange1(String range1) {
		this.range1 = range1;
	}

	public String getRange2() {
		return range2;
	}

	public void setRange2(String range2) {
		this.range2 = range2;
	}

	public String getRange3() {
		return range3;
	}

	public void setRange3(String range3) {
		this.range3 = range3;
	}

	public String getRange4() {
		return range4;
	}

	public void setRange4(String range4) {
		this.range4 = range4;
	}

	public String getRange5() {
		return range5;
	}

	public void setRange5(String range5) {
		this.range5 = range5;
	}

	public String getRange6() {
		return range6;
	}

	public void setRange6(String range6) {
		this.range6 = range6;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public List<String> getQueryType() {
		return queryType;
	}

	public void setQueryType(List<String> queryType) {
		this.queryType = queryType;
	}

	public List<String> getQueryToorder() {
		return queryToorder;
	}

	public void setQueryToorder(List<String> queryToorder) {
		this.queryToorder = queryToorder;
	}
	
}